#include "cCanvas.h"

cCanvas::cCanvas(cHwnd * hwndParent,int x,int y,int largeur,int hauteur,cHwnd * HWNDParent ):
    cControl(hwndParent)
{
    //ctor
     HWND leParent=hwndParent->getHwnd();
    if(HWNDParent!=NULL)
        leParent=HWNDParent->getHwnd();


    hWnd=CreateWindow("STATIC", NULL, WS_CHILD  | SS_ETCHEDFRAME | WS_VISIBLE ,
                      x, y, largeur, hauteur,  leParent, NULL, hInstance, NULL);
    FinalInit();

}

cCanvas::~cCanvas()
{
    //dtor
}


bool cCanvas::TraitementEvent(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam,LRESULT & resultat)
{
    switch(message)
    {
      case WM_ERASEBKGND:
        {
            /*resultat=true;
            return true;*/
            break;
        }

        case WM_PAINT:
        {
            /*resultat=false;
            return true;*/
            break;
        }
    };
    return false;
}


